package com.example.sprintbootarithmetic.DataStructure.arrayQueue;

import java.util.Scanner;

public class Demo {
    public static void main(String[] args) {
        boolean flag = true;
        Scanner sc = new Scanner(System.in);
        Queue s = new Queue(5);
        while (flag) {
            System.out.println("���������ѡ��:");
            System.out.println("1.����");
            System.out.println("2.����");
            System.out.println("3.��ȡ���е�һ������");
            System.out.println("4.��ȡ�������һ������");
            System.out.println("5.�õ�ȫ������");
            System.out.println("6.�˳�");
            int input = sc.nextInt();
            switch (input) {
                case 1:
                    System.out.print("��ȡ������Ϊ:\t");
                    System.out.println(s.getitem());
                    break;
                case 2:
                    System.out.println("����������:");
                    System.out.println(s.additem(sc.nextInt()));
                    break;
                case 3:
                    System.out.println(s.getfirst());
                    break;
                case 4:
                    System.out.println(s.getlast());
                    break;
                case 5:
                    s.getall();
                    break;
                case 6:
                    System.out.println("��ӭ�´�ʹ�á���");
                    flag = false;
                    break;
                default:
                    System.out.println("�����������������");
                    break;
            }
        }
    }
}
